<?php

class Users_Profile_EditErrorView extends SrsUsersBaseView
{
	public function executeHtml(AgaviRequestDataHolder $rd)
	{
		$this->setupHtml($rd);

		$this->getLayer('content')->setTemplate('Profile/EditInput');

		$referer = $rd->getParameter('referer', $this->genUrl('account.read'));

		$currentUser = $this->user->getCurrentUser();

		$user = $rd->getParameter('user');
		$user['id'] = $currentUser['id'];

		$form = new AgaviParameterHolder(array(
			'user' => array(
				'email'  => $user['email'],
				'name'   => $user['name'],
			),
			'referer' => $referer,
		));

		$this->populate('editAccount', $form);

		$this->setAttribute('user', $user);
		$this->setAttribute('referer', $referer);
	}
}